package com.tinckay.entity.po;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;

import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;

import com.tinckay.common.constant.ProjectConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;

/**
 * <p>
 *
 * </p>
 *
 * @author Jean
 * @since 2018-10-21
 */
@Data
@Accessors(chain = true)
@TableName("pour_sto_model")
@ApiModel(value = "StoModel对象", description = "仓体模型")
public class StoModel extends Model<StoModel> {

    private static final long serialVersionUID = 1L;

    @NotNull(message = "id不能为空", groups = ProjectConstant.Update.class)
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @NotNull(message = "长度不能为空", groups = ProjectConstant.Save.class)
    @ApiModelProperty(value = "长")
    private Double length;

    @NotNull(message = "宽度不能为空", groups = ProjectConstant.Save.class)
    @ApiModelProperty(value = "宽")
    private Double width;

    @ApiModelProperty(value = "左宽")
    private Double leftWidth;

    @ApiModelProperty(value = "右宽")
    private Double rightWidth;

    @ApiModelProperty(value = "左高")
    @NotNull(message = "左高不能为空", groups = ProjectConstant.Save.class)
    private Double leftHeight;

    @ApiModelProperty(value = "右高")
    private Double rightHeight;

    @ApiModelProperty(value = "高差")
    private Double heiDifference;

    @ApiModelProperty(value = "体积")
    private Double volume;

    @ApiModelProperty(value = "模型名称")
    private String name;

    @ApiModelProperty(value = "模型类型")
    private String type;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    private LocalDateTime dataTime;

    @ApiModelProperty(value = "数据库存储时间", hidden = true)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间", hidden = true)
    private LocalDateTime updateTime;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
